home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume10 / xpbiff / patch1 < prev    next >
Encoding:
Internet Message Format  |  1990-12-09  |  22.1 KB

  1. Path: uunet!cs.utexas.edu!wuarchive!julius.cs.uiuc.edu!apple!sun-barr!newstop!exodus!appserv!uunet.UU.NET
  2. From: kddlab!isl.yamaha.co.jp!shutoh@uunet.UU.NET (Kazuhiko Shutoh)
  3. Newsgroups: comp.sources.x
  4. Subject: v10i090: xpbiff -- xbiff with popups, Patch1, Part01/01
  5. Message-ID: <333@appserv.Eng.Sun.COM>
  6. Date: 1 Dec 90 08:23:09 GMT
  7. References: <csx-10i090:xpbiff@uunet.UU.NET>
  8. Sender: news@exodus.Eng.Sun.COM
  9. Lines: 685
  10. Approved: argv@sun.com
  11.  
  12. Submitted-by: kddlab!isl.yamaha.co.jp!shutoh@uunet.UU.NET (Kazuhiko Shutoh)
  13. Posting-number: Volume 10, Issue 90
  14. Archive-name: xpbiff/patch1
  15. Patch-To: xpbiff: Volume 10, Issue 1
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of shell archive."
  24. # Contents:  xpbiff.patch1.comp
  25. # Wrapped by shutoh@uni on Sat Dec  1 10:48:49 1990
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'xpbiff.patch1.comp' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'xpbiff.patch1.comp'\"
  29. else
  30. echo shar: Extracting \"'xpbiff.patch1.comp'\" \(20010 characters\)
  31. sed "s/^X//" >'xpbiff.patch1.comp' <<'END_OF_FILE'
  32. Xdiff -rc old.comp/README new.comp/README
  33. X*** old.comp/README    Sat Dec  1 10:33:34 1990
  34. X--- new.comp/README    Sat Dec  1 10:43:06 1990
  35. X***************
  36. X*** 3,9 ****
  37. X--- 3,11 ----
  38. X  
  39. X                  xpbiff 
  40. X  
  41. X+     Popup biff for X, including show mail headers.
  42. X  
  43. X+ 
  44. X  * Command line options
  45. X  
  46. X  Usage : xpbiff [Toolkit-Options][-nfg noarrive_bitmap_foreground color]
  47. X***************
  48. X*** 52,57 ****
  49. X--- 54,63 ----
  50. X  -patchlevel :
  51. X      Show current patchlevel and source code version.
  52. X  
  53. X+ * Adding feature:
  54. X+     
  55. X+     Keep top window stack option added(-keep).
  56. X+     Click mailbox window, redisplay mail header popup.
  57. X  
  58. X  * Compile
  59. X  
  60. X***************
  61. X*** 75,102 ****
  62. X      Send any comments, bug reports, etc. to: shutoh@isl.yamaha.co.jp or, 
  63. X      for oversea: shutoh%isl.yamaha.co.jp%kddlab@uunet.uu.net  
  64. X  
  65. X! * Special Thanks to:
  66. X  
  67. X!     Test :
  68. X! 
  69. X!         Shingo Kawasaki(YAMAHA/ISL)
  70. X! 
  71. X!     Bug report & fix suggestion :
  72. X! 
  73. X!         Hidetsugu Nakashio <naka@soum.co.jp>
  74. X!         hkato@krc.sony.co.jp (Hiroshi KATO)
  75. X!         hotta@asimov.soft.flab.fujitsu.co.jp 
  76. X!         ikawa@onion.osaka.jip.co.jp (Ikawa Hiroki)
  77. X!         makimura@agusa.nuee.nagoya-u.ac.jp (Ken Makimura)
  78. X!         murase@ctf5.drl.mei.co.jp 
  79. X!         nishida@phantom.src.ricoh.co.jp (Akihiro Nishida)
  80. X!                 
  81. X!                     Thanks a lot!!!!!!!
  82. X! 
  83. X  --
  84. X                          Kazuhiko Shutoh
  85. X                          InSoft System Lab.
  86. X                          YAMAHA Corp.
  87. X                          shutoh@isl.yamama.co.jp
  88. X  
  89. X  
  90. X--- 81,121 ----
  91. X      Send any comments, bug reports, etc. to: shutoh@isl.yamaha.co.jp or, 
  92. X      for oversea: shutoh%isl.yamaha.co.jp%kddlab@uunet.uu.net  
  93. X  
  94. X! * Special Thanks to comment, bug fix, testing:
  95. X  
  96. X!    Michael Glad <glad@daimi.aau.dk>
  97. X!    Andrew Krzywdzinski <andrew@cs.utk.edu>
  98. X!    Andy Malis <malis@BBN.COM>
  99. X!    Bob Primmer <rprimmer%lemond.webo.dg.com@RELAY.CS.NET>
  100. X!    Chris Garrigues <7thSon@SLCS.SLB.COM>
  101. X!    David Asano <david@comm.toronto.edu>
  102. X!    Felix Ingrand <felix@ai.sri.com>
  103. X!    Hidetsugu Nakashio <naka@soum.co.jp>
  104. X!    Ken Nelson <nelson@wrl.EPI.COM>
  105. X!    Luis Miguel Silveira <lms@sobolev.mit.edu>
  106. X!    Peter Jackson <peterj@cs.adelaide.edu.au>
  107. X!    Robert Lupton (the Good) <rhl@astro.Princeton.EDU>
  108. X!    Steven Reiz <sreiz@cs.vu.nl>
  109. X!    Sting Takubon TAKEUCHI <take@train.ncl.omron.co.jp>
  110. X!    chiba@is.s.u-tokyo.ac.jp (Chiba)
  111. X!    hkato@krc.sony.co.jp (Hiroshi KATO)
  112. X!    hotta@flab.fujitsu.co.jp (Yuji Hotta)
  113. X!    imp@Solbourne.COM (Warner Losh)
  114. X!    jgraf@smdgr1.intel.com (Jim Graf )
  115. X!    lindheim@sampson.ccsf.caltech.edu (Jan Lindheim)
  116. X!    lusk@antares.mcs.anl.gov (Rusty Lusk)
  117. X!    masuhara@is.s.u-tokyo.ac.jp
  118. X!    murase@ctf5.drl.mei.co.jp (Kouichi Murase)
  119. X!    nishida@phantom.src.ricoh.co.jp (Akihiro Nishida)  
  120. X!    rekers@cwi.nl (Jan Rekers)
  121. X!    remy@cs.uoregon.edu (Remy Evard)
  122. X!    vita@oxford.dab.ge.com (Mark Vita)
  123. X!  
  124. X  --
  125. X                          Kazuhiko Shutoh
  126. X                          InSoft System Lab.
  127. X                          YAMAHA Corp.
  128. X                          shutoh@isl.yamama.co.jp
  129. X+ 
  130. X  
  131. X  
  132. Xdiff -rc old.comp/patchlevel.h new.comp/patchlevel.h
  133. X*** old.comp/patchlevel.h    Sat Dec  1 10:33:35 1990
  134. X--- new.comp/patchlevel.h    Sat Dec  1 10:38:57 1990
  135. X***************
  136. X*** 1,4 ****
  137. X  
  138. X! #define PATCHLEVEL 0
  139. X  
  140. X  
  141. X--- 1,5 ----
  142. X  
  143. X! #define PATCHLEVEL 1
  144. X! 
  145. X  
  146. X  
  147. Xdiff -rc old.comp/xpbiff.c new.comp/xpbiff.c
  148. X*** old.comp/xpbiff.c    Sat Dec  1 10:33:36 1990
  149. X--- new.comp/xpbiff.c    Sat Dec  1 10:38:44 1990
  150. X***************
  151. X*** 1,11 ****
  152. X  
  153. X! static char     sccsid[] = "@(#)xpbiff.c    1.15   10/18/90";
  154. X  
  155. X  /*
  156. X   * xpbiff - popup biff for X
  157. X   * 
  158. X   * Author: Kazuhiko Shutoh, 1990.
  159. X!  * 
  160. X   * Permission to use, copy, modify and distribute without charge this software,
  161. X   * documentation, images, etc. is granted, provided that this comment and the
  162. X   * author's name is retained.  The author assumes no responsibility for lost
  163. X--- 1,45 ----
  164. X  
  165. X! static char     sccsid[] = "@(#)xpbiff.c    1.18   12/1/90";
  166. X  
  167. X  /*
  168. X   * xpbiff - popup biff for X
  169. X   * 
  170. X   * Author: Kazuhiko Shutoh, 1990.
  171. X!  *
  172. X!  *  Special thanks for comment, bug fix, testing to:
  173. X!  *
  174. X!  *  Michael Glad <glad@daimi.aau.dk>
  175. X!  *  Andrew Krzywdzinski <andrew@cs.utk.edu>
  176. X!  *  Andy Malis <malis@BBN.COM>
  177. X!  *  Bob Primmer <rprimmer%lemond.webo.dg.com@RELAY.CS.NET>
  178. X!  *  Chris Garrigues <7thSon@SLCS.SLB.COM>
  179. X!  *  David Asano <david@comm.toronto.edu>
  180. X!  *  Felix Ingrand <felix@ai.sri.com>
  181. X!  *  Hidetsugu Nakashio <naka@soum.co.jp>
  182. X!  *  Ken Nelson <nelson@wrl.EPI.COM>
  183. X!  *  Luis Miguel Silveira <lms@sobolev.mit.edu>
  184. X!  *  Peter Jackson <peterj@cs.adelaide.edu.au>
  185. X!  *  Robert Lupton (the Good) <rhl@astro.Princeton.EDU>
  186. X!  *  Steven Reiz <sreiz@cs.vu.nl>
  187. X!  *  Sting Takubon TAKEUCHI <take@train.ncl.omron.co.jp>
  188. X!  *  chiba@is.s.u-tokyo.ac.jp (Chiba)
  189. X!  *  hkato@krc.sony.co.jp (Hiroshi KATO)
  190. X!  *  hotta@flab.fujitsu.co.jp (Yuji Hotta)
  191. X!  *  imp@Solbourne.COM (Warner Losh)
  192. X!  *  jgraf@smdgr1.intel.com (Jim Graf )
  193. X!  *  lindheim@sampson.ccsf.caltech.edu (Jan Lindheim)
  194. X!  *  lusk@antares.mcs.anl.gov (Rusty Lusk)
  195. X!  *  masuhara@is.s.u-tokyo.ac.jp
  196. X!  *  murase@ctf5.drl.mei.co.jp (Kouichi Murase)
  197. X!  *  nishida@phantom.src.ricoh.co.jp (Akihiro Nishida)  
  198. X!  *  rekers@cwi.nl (Jan Rekers)
  199. X!  *  remy@cs.uoregon.edu (Remy Evard)
  200. X!  *  vita@oxford.dab.ge.com (Mark Vita)
  201. X!  *
  202. X!  *
  203. X!  *                        THANKS A LOT!!!!
  204. X!  *
  205. X!  *
  206. X   * Permission to use, copy, modify and distribute without charge this software,
  207. X   * documentation, images, etc. is granted, provided that this comment and the
  208. X   * author's name is retained.  The author assumes no responsibility for lost
  209. X***************
  210. X*** 19,29 ****
  211. X--- 53,72 ----
  212. X  #include <X11/Intrinsic.h>
  213. X  #include <X11/StringDefs.h>
  214. X  #include <X11/Shell.h>
  215. X+ #ifndef X11R3
  216. X  #include <X11/Xaw/Box.h>
  217. X  #include <X11/Xaw/Label.h>
  218. X  #include <X11/Xaw/Command.h>
  219. X  #include <X11/Xaw/AsciiText.h>
  220. X  #include <X11/Xaw/Cardinals.h>
  221. X+ #include <X11/Xmu/Drawing.h>
  222. X+ #else
  223. X+ #include <X11/Box.h>
  224. X+ #include <X11/Label.h>
  225. X+ #include <X11/Command.h>
  226. X+ #include <X11/AsciiText.h>
  227. X+ #include <X11/Cardinals.h>
  228. X+ #endif
  229. X  #include <X11/Xos.h>
  230. X  #include <fcntl.h>
  231. X  #include <sys/types.h>
  232. X***************
  233. X*** 48,61 ****
  234. X  
  235. X  XtCallbackProc  redraw_callback();
  236. X  XtCallbackProc  BreakPopup();
  237. X  XtTimerCallbackProc Polling();
  238. X  char           *GetMailHeader();
  239. X  void            PopupMailHeader();
  240. X  void            AnimateBiff();
  241. X  
  242. X- 
  243. X  Widget          toplevel, biff, header, info_base, info, popdown_button;
  244. X  
  245. X  /*
  246. X   * widget tree:
  247. X   * 
  248. X--- 91,105 ----
  249. X  
  250. X  XtCallbackProc  redraw_callback();
  251. X  XtCallbackProc  BreakPopup();
  252. X+ XtCallbackProc  popup_again();
  253. X  XtTimerCallbackProc Polling();
  254. X  char           *GetMailHeader();
  255. X  void            PopupMailHeader();
  256. X  void            AnimateBiff();
  257. X  
  258. X  Widget          toplevel, biff, header, info_base, info, popdown_button;
  259. X  
  260. X+ 
  261. X  /*
  262. X   * widget tree:
  263. X   * 
  264. X***************
  265. X*** 68,73 ****
  266. X--- 112,120 ----
  267. X  Pixmap          arrivePixmap, noPixmap, workPixmap;
  268. X  int             width, height;
  269. X  unsigned char   current_status;
  270. X+ unsigned char   showing_header = 0;
  271. X+ long            mail_size = 0;
  272. X+ XtIntervalId    polling_id;
  273. X  
  274. X  String          colors[4] = {"dummy_colorname", "dummy_colorname", "dummy_colorname", "dummy_colorname"};
  275. X  char            spool_path[100];
  276. X***************
  277. X*** 74,84 ****
  278. X--- 121,134 ----
  279. X  unsigned long   polling_time = 15000;    /* Default 15 second */
  280. X  
  281. X  unsigned char   raise = True;
  282. X+ unsigned char    stay_raised = False;
  283. X  unsigned char   animate = True;
  284. X  unsigned char   popup = True;
  285. X  unsigned char   bell = True;
  286. X  unsigned char   popdown = True;
  287. X  
  288. X+ unsigned int    no_bitmap_width, no_bitmap_height;
  289. X+ 
  290. X  main(argc, argv)
  291. X      int             argc;
  292. X      char          **argv;
  293. X***************
  294. X*** 88,100 ****
  295. X      XtTranslations  newTranslations;
  296. X      static XtActionsRec redrawActions[] = {
  297. X          {"expose", (XtCallbackProc) redraw_callback},
  298. X      };
  299. X  
  300. X      static char    *overrideTranslations =
  301. X      "<Expose>:    expose() \n\
  302. X!      <ResReq>:    expose()";
  303. X  
  304. X      XColor          backColor, foreColor, dummyColor;
  305. X  
  306. X      int             i;
  307. X      int             count;
  308. X--- 138,153 ----
  309. X      XtTranslations  newTranslations;
  310. X      static XtActionsRec redrawActions[] = {
  311. X          {"expose", (XtCallbackProc) redraw_callback},
  312. X+         {"select", (XtCallbackProc) popup_again},
  313. X      };
  314. X  
  315. X      static char    *overrideTranslations =
  316. X      "<Expose>:    expose() \n\
  317. X!      <ResReq>:    expose() \n\
  318. X!          <Btn1Up>:      select()";
  319. X  
  320. X      XColor          backColor, foreColor, dummyColor;
  321. X+     char        *no_arrival_bitmap_file;
  322. X  
  323. X      int             i;
  324. X      int             count;
  325. X***************
  326. X*** 114,119 ****
  327. X--- 167,173 ----
  328. X  
  329. X      toplevel = XtInitialize("xpbiff", "XPbiff", NULL, 0, &argc, argv);
  330. X  
  331. X+     no_arrival_bitmap_file = NULL;
  332. X      for (count = 1; count < argc; count++) {
  333. X          if ((strcmp("-nfg", argv[count]) == 0) && (count + 1 <= argc))
  334. X              strcpy(colors[0], argv[++count]);
  335. X***************
  336. X*** 127,132 ****
  337. X--- 181,188 ----
  338. X              polling_time = (unsigned long) atol(argv[++count]);
  339. X          else if ((strcmp("-noraise", argv[count]) == 0) && (count + 1 <= argc))
  340. X              raise = False;
  341. X+         else if ((strcmp("-keepup", argv[count]) == 0) && (count + 1 <= argc))
  342. X+              stay_raised = True;
  343. X          else if ((strcmp("-nopopup", argv[count]) == 0) && (count + 1 <= argc))
  344. X              popup = False;
  345. X          else if ((strcmp("-noanimate", argv[count]) == 0) && (count + 1 <= argc))
  346. X***************
  347. X*** 142,153 ****
  348. X              strcpy(colors[3], "black");
  349. X          } else if ((strcmp("-patchlevel", argv[count]) == 0) && (count + 1 <= argc)) {
  350. X              printf("xpbiff -  written by Kazuhiko Shutoh\nSCCS ID : %s\nPatchlevel : %d\n", sccsid, PATCHLEVEL);
  351. X              exit(0);
  352. X          } else {
  353. X              fprintf(stderr, "Usage : xpbiff [Toolkit-Options][-nfg noarrive_bitmap_foreground color]\n");
  354. X              fprintf(stderr, "        [-nbg noarrive_bitmap_background_color][-afg arrive_bitmap_foreground_color]\n");
  355. X              fprintf(stderr, "        [-abg arrive_bitmap_background_color][-polling_time  time(msec)]\n");
  356. X!             fprintf(stderr, "        [-noraise][-nopopup][-noanimate][-nopopdown][-nobell][-mono][-patchlevel]\n");
  357. X              exit(0);
  358. X          }
  359. X      }
  360. X--- 198,239 ----
  361. X              strcpy(colors[3], "black");
  362. X          } else if ((strcmp("-patchlevel", argv[count]) == 0) && (count + 1 <= argc)) {
  363. X              printf("xpbiff -  written by Kazuhiko Shutoh\nSCCS ID : %s\nPatchlevel : %d\n", sccsid, PATCHLEVEL);
  364. X+             printf("\nSpecial thanks to:\n\
  365. X+     Michael Glad <glad@daimi.aau.dk>\n\
  366. X+     Andrew Krzywdzinski <andrew@cs.utk.edu>\n\
  367. X+     Andy Malis <malis@BBN.COM>\n\
  368. X+     Bob Primmer <rprimmer%lemond.webo.dg.com@RELAY.CS.NET>\n\
  369. X+     Chris Garrigues <7thSon@SLCS.SLB.COM>\n\
  370. X+     David Asano <david@comm.toronto.edu>\n\
  371. X+     Felix Ingrand <felix@ai.sri.com>\n\
  372. X+     Hidetsugu Nakashio <naka@soum.co.jp>\n\
  373. X+     Ken Nelson <nelson@wrl.EPI.COM>\n\
  374. X+     Luis Miguel Silveira <lms@sobolev.mit.edu>\n\
  375. X+     Peter Jackson <peterj@cs.adelaide.edu.au>\n\
  376. X+     Robert Lupton (the Good) <rhl@astro.Princeton.EDU>\n\
  377. X+     Steven Reiz <sreiz@cs.vu.nl>\n\
  378. X+     Sting Takubon TAKEUCHI <take@train.ncl.omron.co.jp>\n\
  379. X+     chiba@is.s.u-tokyo.ac.jp (Chiba)\n\
  380. X+     hkato@krc.sony.co.jp (Hiroshi KATO)\n\
  381. X+     hotta@flab.fujitsu.co.jp (Yuji Hotta)\n\
  382. X+     imp@Solbourne.COM (Warner Losh)\n\
  383. X+     jgraf@smdgr1.intel.com (Jim Graf )\n\
  384. X+     lindheim@sampson.ccsf.caltech.edu (Jan Lindheim)\n\
  385. X+     lusk@antares.mcs.anl.gov (Rusty Lusk)\n\
  386. X+     masuhara@is.s.u-tokyo.ac.jp\n\
  387. X+     murase@ctf5.drl.mei.co.jp (Kouichi Murase)\n\
  388. X+     nishida@phantom.src.ricoh.co.jp (Akihiro Nishida)  \n\
  389. X+     rekers@cwi.nl (Jan Rekers)\n\
  390. X+     remy@cs.uoregon.edu (Remy Evard)\n\
  391. X+     vita@oxford.dab.ge.com (Mark Vita)\n");
  392. X              exit(0);
  393. X+         } else if ((strcmp("-bitmap", argv[count]) == 0) && (count + 1 <= argc)) {
  394. X+             no_arrival_bitmap_file = argv[++count];
  395. X          } else {
  396. X              fprintf(stderr, "Usage : xpbiff [Toolkit-Options][-nfg noarrive_bitmap_foreground color]\n");
  397. X              fprintf(stderr, "        [-nbg noarrive_bitmap_background_color][-afg arrive_bitmap_foreground_color]\n");
  398. X              fprintf(stderr, "        [-abg arrive_bitmap_background_color][-polling_time  time(msec)]\n");
  399. X!             fprintf(stderr, "        [-noraise][-nopopup][-noanimate][-nopopdown][-keepup][-nobell][-mono][-patchlevel][-bitmap bitmap_file]\n");
  400. X              exit(0);
  401. X          }
  402. X      }
  403. X***************
  404. X*** 169,178 ****
  405. X  
  406. X      XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[0], &foreColor, &dummyColor);
  407. X      XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[1], &backColor, &dummyColor);
  408. X!     noPixmap = XCreatePixmapFromBitmapData(XtDisplay(toplevel), XtWindow(biff),
  409. X!                   no_bits, no_width, no_height, foreColor.pixel,
  410. X!          backColor.pixel, DefaultDepthOfScreen(XtScreen(toplevel)));
  411. X  
  412. X      gcBiff = XCreateGC(XtDisplay(toplevel), XtWindow(biff),
  413. X                 (unsigned long) 0, NULL);
  414. X      XSetGraphicsExposures(XtDisplay(toplevel), gcBiff, False);
  415. X--- 255,287 ----
  416. X  
  417. X      XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[0], &foreColor, &dummyColor);
  418. X      XAllocNamedColor(XtDisplay(toplevel), DefaultColormapOfScreen(XtScreen(toplevel)), colors[1], &backColor, &dummyColor);
  419. X!     if(no_arrival_bitmap_file == NULL) {
  420. X!         noPixmap = XCreatePixmapFromBitmapData(XtDisplay(toplevel), XtWindow(biff), no_bits, no_width,
  421. X!                 no_height, foreColor.pixel, backColor.pixel, DefaultDepthOfScreen(XtScreen(toplevel)));
  422. X!         no_bitmap_width = no_width;
  423. X!         no_bitmap_height = no_height;
  424. X!     }
  425. X!     else {
  426. X!         int usr_bitmap_x, usr_bitmap_y;
  427. X!         unsigned char *usr_bitmap_data;
  428. X  
  429. X+         if(XmuReadBitmapDataFromFile(no_arrival_bitmap_file, &no_bitmap_width, &no_bitmap_height,
  430. X+                 &usr_bitmap_data, &usr_bitmap_x, &usr_bitmap_y) != BitmapSuccess) {
  431. X+             fprintf(stderr, "cannot make a bitmap '%s'.\n", no_arrival_bitmap_file);
  432. X+             exit(1);
  433. X+         }
  434. X+ 
  435. X+         noPixmap = XCreatePixmapFromBitmapData(XtDisplay(toplevel), XtWindow(biff), usr_bitmap_data,
  436. X+                 no_bitmap_width, no_bitmap_height, foreColor.pixel, backColor.pixel,
  437. X+                 DefaultDepthOfScreen(XtScreen(toplevel)));
  438. X+         i = 0;
  439. X+         XtSetArg(args[i], XtNwidth, no_bitmap_width);
  440. X+         i++;
  441. X+         XtSetArg(args[i], XtNheight, no_bitmap_height);
  442. X+         i++;
  443. X+         XtSetValues(biff, args, i);
  444. X+     }
  445. X+ 
  446. X      gcBiff = XCreateGC(XtDisplay(toplevel), XtWindow(biff),
  447. X                 (unsigned long) 0, NULL);
  448. X      XSetGraphicsExposures(XtDisplay(toplevel), gcBiff, False);
  449. X***************
  450. X*** 197,203 ****
  451. X  
  452. X  
  453. X      /* Interval timer start     */
  454. X!     XtAddTimeOut(polling_time, Polling, NULL);
  455. X  
  456. X      XtMainLoop();
  457. X  }
  458. X--- 306,312 ----
  459. X  
  460. X  
  461. X      /* Interval timer start     */
  462. X!     polling_id = XtAddTimeOut(polling_time, Polling, NULL);
  463. X  
  464. X      XtMainLoop();
  465. X  }
  466. X***************
  467. X*** 223,229 ****
  468. X      if (current_status == ARRIVE) {
  469. X          XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff), gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
  470. X      } else {
  471. X!         XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
  472. X      }
  473. X  }
  474. X  
  475. X--- 332,338 ----
  476. X      if (current_status == ARRIVE) {
  477. X          XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff), gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
  478. X      } else {
  479. X!         XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0, no_bitmap_width, no_bitmap_height, 0, 0);
  480. X      }
  481. X  }
  482. X  
  483. X***************
  484. X*** 231,240 ****
  485. X  XtTimerCallbackProc
  486. X  Polling(client_data, id)
  487. X      caddr_t         client_data;
  488. X!     XtIntervalId    id;
  489. X  {
  490. X  
  491. X-     static long     mail_size = 0;
  492. X      struct stat     file_stat;
  493. X      char           *mail_header;
  494. X  
  495. X--- 340,348 ----
  496. X  XtTimerCallbackProc
  497. X  Polling(client_data, id)
  498. X      caddr_t         client_data;
  499. X!     XtIntervalId    *id;
  500. X  {
  501. X  
  502. X      struct stat     file_stat;
  503. X      char           *mail_header;
  504. X  
  505. X***************
  506. X*** 279,285 ****
  507. X                  XBell(XtDisplay(toplevel), 0);
  508. X          } else {
  509. X              mail_size = file_stat.st_size;
  510. X!             if (raise == True)
  511. X                  XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
  512. X              if (popup == True)
  513. X                  BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
  514. X--- 387,393 ----
  515. X                  XBell(XtDisplay(toplevel), 0);
  516. X          } else {
  517. X              mail_size = file_stat.st_size;
  518. X!             if (raise == True && stay_raised == False)
  519. X                  XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
  520. X              if (popup == True)
  521. X                  BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
  522. X***************
  523. X*** 289,296 ****
  524. X      if (current_status == ARRIVE) {
  525. X          current_status = NO;
  526. X          XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0,
  527. X!               arrive_width, arrive_height, 0, 0);
  528. X!         if (raise == True)
  529. X              XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
  530. X          if (popup == True)
  531. X              BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
  532. X--- 397,404 ----
  533. X      if (current_status == ARRIVE) {
  534. X          current_status = NO;
  535. X          XCopyArea(XtDisplay(toplevel), noPixmap, XtWindow(biff), gcBiff, 0, 0,
  536. X!               no_bitmap_width, no_bitmap_height, 0, 0);
  537. X!         if (raise == True && stay_raised == False)
  538. X              XLowerWindow(XtDisplay(toplevel), XtWindow(toplevel));
  539. X          if (popup == True)
  540. X              BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
  541. X***************
  542. X*** 297,303 ****
  543. X      }
  544. X      /* No arrive */
  545. X  
  546. X!     XtAddTimeOut(polling_time, Polling, NULL);
  547. X  
  548. X  }
  549. X  
  550. X--- 405,411 ----
  551. X      }
  552. X      /* No arrive */
  553. X  
  554. X!     polling_id = XtAddTimeOut(polling_time, Polling, NULL);
  555. X  
  556. X  }
  557. X  
  558. X***************
  559. X*** 385,391 ****
  560. X  
  561. X      free(head);
  562. X  
  563. X!     XtPopup(header, XtGrabExclusive);
  564. X  }
  565. X  
  566. X  
  567. X--- 493,502 ----
  568. X  
  569. X      free(head);
  570. X  
  571. X!     XtPopup(header, XtGrabNone);
  572. X! 
  573. X!     showing_header = 1;
  574. X! 
  575. X  }
  576. X  
  577. X  
  578. X***************
  579. X*** 395,407 ****
  580. X  
  581. X      struct stat     status;
  582. X      int             fd;
  583. X!     char           *mail_header, *mail_buffer, *head;
  584. X  
  585. X      /* get mail headers */
  586. X  
  587. X      fd = open(spool_path, O_RDONLY);
  588. X      fstat(fd, &status);
  589. X!     mail_buffer = (char *) malloc((unsigned int) (status.st_size + 1));
  590. X      head = mail_header = (char *) malloc((unsigned int) (status.st_size + 1));
  591. X      read(fd, mail_buffer, status.st_size);
  592. X      close(fd);
  593. X--- 506,518 ----
  594. X  
  595. X      struct stat     status;
  596. X      int             fd;
  597. X!     char           *mail_buffer_saved, *mail_header, *mail_buffer, *head;
  598. X  
  599. X      /* get mail headers */
  600. X  
  601. X      fd = open(spool_path, O_RDONLY);
  602. X      fstat(fd, &status);
  603. X!     mail_buffer = mail_buffer_saved = (char *) malloc((unsigned int) (status.st_size + 1));
  604. X      head = mail_header = (char *) malloc((unsigned int) (status.st_size + 1));
  605. X      read(fd, mail_buffer, status.st_size);
  606. X      close(fd);
  607. X***************
  608. X*** 420,426 ****
  609. X  
  610. X      }
  611. X      *mail_header = NULL;
  612. X! 
  613. X      free(mail_buffer);
  614. X      return (head);
  615. X  
  616. X--- 531,538 ----
  617. X  
  618. X      }
  619. X      *mail_header = NULL;
  620. X!     
  621. X!     free(mail_buffer_saved);
  622. X      free(mail_buffer);
  623. X      return (head);
  624. X  
  625. X***************
  626. X*** 437,441 ****
  627. X--- 549,603 ----
  628. X  
  629. X      XtPopdown(header);
  630. X      XtDestroyWidget(header);
  631. X+ 
  632. X+     showing_header = 0;
  633. X+ }
  634. X+ 
  635. X+ XtCallbackProc
  636. X+ popup_again(widget, client_data, call_data)
  637. X+      Widget widget;
  638. X+      caddr_t client_data;
  639. X+      caddr_t call_data;
  640. X+ {
  641. X+     struct stat file_stat;
  642. X+     char *mail_header;
  643. X+ 
  644. X+     if ((stat(spool_path, &file_stat) == 0) && (file_stat.st_size != 0)) {
  645. X+     /* There are mail */
  646. X+     if (current_status == NO) {
  647. X+         /* the click catchs new mail */
  648. X+         current_status = ARRIVE;
  649. X+         mail_size = file_stat.st_size;
  650. X+         if (popup == True)
  651. X+         mail_header = GetMailHeader();
  652. X+         if (raise == True)
  653. X+         XRaiseWindow(XtDisplay(toplevel), XtWindow(toplevel));
  654. X+         if (animate == True)
  655. X+         AnimateBiff();
  656. X+         XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff),
  657. X+               gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
  658. X+         if (popup == True)
  659. X+         PopupMailHeader(mail_header);
  660. X+         XSync(XtDisplay(toplevel), 0);
  661. X+         if (bell == True)
  662. X+         XBell(XtDisplay(toplevel), 0);
  663. X+     } else {
  664. X+         mail_size = file_stat.st_size;
  665. X+         if (popup == True)
  666. X+         mail_header = GetMailHeader();
  667. X+         if (popup == True && showing_header)
  668. X+         BreakPopup(toplevel, (XtPointer) NULL, (XtPointer) NULL);
  669. X+         if (raise == True)
  670. X+         XRaiseWindow(XtDisplay(toplevel), XtWindow(toplevel));
  671. X+         XCopyArea(XtDisplay(toplevel), arrivePixmap, XtWindow(biff),
  672. X+               gcBiff, 0, 0, arrive_width, arrive_height, 0, 0);
  673. X+         if (popup == True)
  674. X+         PopupMailHeader(mail_header);
  675. X+         XSync(XtDisplay(toplevel), 0);
  676. X+     }
  677. X+     }
  678. X+ 
  679. X+     XtRemoveTimeOut(polling_id);
  680. X+     polling_id = XtAddTimeOut(polling_time, Polling, NULL);
  681. X  
  682. X  }
  683. END_OF_FILE
  684. if test 20010 -ne `wc -c <'xpbiff.patch1.comp'`; then
  685.     echo shar: \"'xpbiff.patch1.comp'\" unpacked with wrong size!
  686. fi
  687. # end of 'xpbiff.patch1.comp'
  688. fi
  689. echo shar: End of shell archive.
  690. exit 0
  691.  
  692.  
  693. dan
  694. ----------------------------------------------------
  695. O'Reilly && Associates   argv@sun.com / argv@ora.com
  696. Opinions expressed reflect those of the author only.
  697. --
  698. dan
  699. ----------------------------------------------------
  700. O'Reilly && Associates   argv@sun.com / argv@ora.com
  701. Opinions expressed reflect those of the author only.
  702.